Sql |
SELECT distinct a.style_id,
case a.style_id
when 10953 then 1
when 10955 then 2
when 146845 then 3
when 10952 then 4
when 137552 then 5
when 256864 then 6
when 10954 then 7
when 256760 then 8
when 123701 then 9
when 104860 then 10
when 124573 then 11
when 124244 then 12
when 43642 then 13
when 267030 then 14
when 272963 then 15
when 266615 then 16
when 256286 then 17
when 218511 then 18
when 262364 then 19
when 266832 then 20
when 113257 then 21
when 76379 then 22
when 265008 then 23
when 253093 then 24
when 135361 then 25
when 267378 then 26
when 43625 then 27
when 65699 then 28
when 179106 then 29
when 248432 then 30
when 43635 then 31
when 255122 then 32
when 263808 then 33
when 179750 then 34
when 43626 then 35
when 185615 then 36
when 222359 then 37
when 263960 then 38
when 262373 then 39
when 263790 then 40
when 266635 then 41
when 256892 then 42
when 256645 then 43
when 43634 then 44
when 182387 then 45
when 249008 then 46
when 263202 then 47
when 267065 then 48
when 192608 then 49
when 261486 then 50
when 111535 then 51
when 267057 then 52
when 179122 then 53
when 252395 then 54
when 11376 then 55
when 273798 then 56
when 251566 then 57
when 254385 then 58
when 249965 then 59
when 170855 then 60
when 264739 then 61
when 218516 then 62
when 264446 then 63
when 304757 then 64
when 260785 then 65
when 206584 then 66
when 266755 then 67
when 261170 then 68
when 117030 then 69
when 222566 then 70
when 121131 then 71
when 179108 then 72
when 250882 then 73
when 177538 then 74
when 104547 then 75
when 154995 then 76
when 301457 then 77
when 109005 then 78
when 267397 then 79
when 179120 then 80
when 266646 then 81
when 255271 then 82
when 49055 then 83
when 123170 then 84
when 247648 then 85
when 76932 then 86
when 266067 then 87
when 178953 then 88
when 256287 then 89
when 273959 then 90
when 264820 then 91
when 200180 then 92
when 124721 then 93
when 218515 then 94
when 283949 then 95
when 264756 then 96
when 266580 then 97
when 273568 then 98
when 245440 then 99
when 122549 then 100
when 152052 then 101
when 278157 then 102
when 100336 then 103
when 251418 then 104
when 266923 then 105
when 49050 then 106
when 214430 then 107
when 74885 then 108
when 147427 then 109
when 250995 then 110
when 255616 then 111
when 260619 then 112
when 261492 then 113
when 179458 then 114
when 152681 then 115
when 122644 then 116
when 288892 then 117
when 113771 then 118
when 221046 then 119
when 221044 then 120
when 225759 then 121
when 179109 then 122
when 267395 then 123
when 253332 then 124
when 298925 then 125
when 196128 then 126
when 169560 then 127
when 251759 then 128
when 266068 then 129
when 267337 then 130
when 266134 then 131
when 129318 then 132
when 287260 then 133
when 217711 then 134
when 87275 then 135
when 266495 then 136
when 263421 then 137
when 251688 then 138
when 263245 then 139
when 125806 then 140
when 116657 then 141
when 302756 then 142
when 126346 then 143
when 192170 then 144
when 114579 then 145
when 268769 then 146
when 129037 then 147
when 309700 then 148
when 266385 then 149
when 266696 then 150
when 218512 then 151
when 266485 then 152
when 274203 then 153
when 298175 then 154
when 279779 then 155
when 133955 then 156
when 250992 then 157
when 283771 then 158
when 202970 then 159
when 126190 then 160
when 219982 then 161
when 254225 then 162
when 128766 then 163
when 124869 then 164
when 133333 then 165
when 170287 then 166
when 132599 then 167
when 213013 then 168
when 124089 then 169
when 245159 then 170
when 123031 then 171
when 286445 then 172
when 251689 then 173
when 251561 then 174
when 213786 then 175
when 289245 then 176
when 124087 then 177
when 268642 then 178
when 168578 then 179
when 179121 then 180
when 17075 then 181
when 281898 then 182
when 303291 then 183
when 11415 then 184
when 256290 then 185
when 288675 then 186
when 298195 then 187
when 49057 then 188
when 168610 then 189
when 203983 then 190
when 278069 then 191
when 302759 then 192
when 266509 then 193
when 203445 then 194
when 43620 then 195
when 307357 then 196
when 155732 then 197
when 232439 then 198
when 266106 then 199
when 250994 then 200
when 293326 then 201
when 208049 then 202
when 144145 then 203
when 202977 then 204
when 288672 then 205
when 11401 then 206
when 165141 then 207
when 11414 then 208
when 105193 then 209
when 266103 then 210
when 78029 then 211
when 141725 then 212
when 193279 then 213
when 213270 then 214
when 266842 then 215
when 245655 then 216
when 266623 then 217
when 125087 then 218
when 115793 then 219
when 108741 then 220
when 141298 then 221
when 108807 then 222
when 304452 then 223
when 327068 then 224
when 282916 then 225
when 213055 then 226
when 282684 then 227
when 253248 then 228
when 11411 then 229
when 218299 then 230
when 254228 then 231
when 193278 then 232
when 193947 then 233
when 252394 then 234
when 282912 then 235
when 217657 then 236
when 298095 then 237
when 162136 then 238
when 162135 then 239
when 260879 then 240
when 141772 then 241
when 251692 then 242
when 251690 then 243
when 316981 then 244
when 252427 then 245
when 117637 then 246
when 287198 then 247
when 298178 then 248
when 298176 then 249
when 298177 then 250
when 143337 then 251
when 250883 then 252
when 274194 then 253
when 101828 then 254
when 256447 then 255
when 256449 then 256
when 100013 then 257
when 179107 then 258
when 140065 then 259
when 217691 then 260
when 311584 then 261
when 303332 then 262
when 303333 then 263
when 134638 then 264
when 245163 then 265
when 94332 then 266
when 256415 then 267
when 264422 then 268
when 261488 then 269
when 253141 then 270
when 268848 then 271
when 154978 then 272
when 254357 then 273
when 256448 then 274
when 125157 then 275
when 252338 then 276
when 211307 then 277
when 218558 then 278
when 255963 then 279
when 216843 then 280
when 298179 then 281
when 252075 then 282
when 148056 then 283
when 256863 then 284
when 104303 then 285
when 267029 then 286
when 271278 then 287
when 43618 then 288
when 263389 then 289
when 133694 then 290
when 195861 then 291
when 212945 then 292
when 154822 then 293
when 287197 then 294
when 263642 then 295
when 246789 then 296
when 199005 then 297
when 256961 then 298
when 262887 then 299
when 124347 then 300
when 267325 then 301
when 253171 then 302
when 283765 then 303
when 74159 then 304
when 207657 then 305
when 125601 then 306
when 288893 then 307
when 266645 then 308
when 245074 then 309
when 277871 then 310
when 276238 then 311
when 132789 then 312
when 284842 then 313
when 100197 then 314
when 219631 then 315
when 191387 then 316
when 278931 then 317
when 205704 then 318
when 266910 then 319
when 289197 then 320
when 266657 then 321
when 167637 then 322
when 199950 then 323
when 277868 then 324
when 277869 then 325
when 283773 then 326
when 232275 then 327
when 248797 then 328
when 189572 then 329
when 203293 then 330
when 268632 then 331
when 284621 then 332
when 284619 then 333
when 282380 then 334
when 303793 then 335
when 323906 then 336
when 195395 then 337
when 219976 then 338
when 249242 then 339
when 264021 then 340
when 118290 then 341
when 281631 then 342
when 328743 then 343
when 328753 then 344
when 164526 then 345
when 245215 then 346
when 245454 then 347
when 127958 then 348
when 220594 then 349
when 110708 then 350
when 264651 then 351
when 183929 then 352
when 198570 then 353
when 206013 then 354
when 254378 then 355
when 268649 then 356
when 316495 then 357
when 328554 then 358
when 265007 then 359
when 141770 then 360
when 158504 then 361
when 121650 then 362
when 220694 then 363
when 262101 then 364
when 122940 then 365
when 225810 then 366
when 269140 then 367
when 328752 then 368
when 245362 then 369
when 264975 then 370
when 318099 then 371
when 318100 then 372
when 318101 then 373
when 125473 then 374
when 218056 then 375
when 66225 then 376
when 166590 then 377
when 283769 then 378
when 158990 then 379
when 182203 then 380
when 193310 then 381
when 268639 then 382
when 288987 then 383
when 204441 then 384
when 221152 then 385
when 268646 then 386
when 172539 then 387
when 175955 then 388
when 207029 then 389
when 298094 then 390
when 287293 then 391
when 123033 then 392
when 318102 then 393
when 225772 then 394
when 66003 then 395
when 220601 then 396
when 86317 then 397
when 254483 then 398
when 298639 then 399
when 249343 then 400
when 192600 then 401
when 245441 then 402
when 169790 then 403
when 118581 then 404
when 295087 then 405
when 320513 then 406
when 252391 then 407
when 289196 then 408
when 298196 then 409
when 188154 then 410
when 196117 then 411
when 169038 then 412
when 199982 then 413
when 253098 then 414
when 319392 then 415
when 248801 then 416
when 100312 then 417
when 251435 then 418
when 260823 then 419
when 283950 then 420
when 288674 then 421
when 302121 then 422
when 196975 then 423
when 271039 then 424
when 182037 then 425
when 168130 then 426
when 104498 then 427
when 189132 then 428
when 199540 then 429
when 220709 then 430
when 271297 then 431
when 263560 then 432
when 262886 then 433
when 225795 then 434
when 122572 then 435
when 189711 then 436
when 192093 then 437
when 271544 then 438
when 43641 then 439
when 302760 then 440
when 102294 then 441
when 13880 then 442
when 141771 then 443
when 175961 then 444
when 181162 then 445
when 196372 then 446
when 214796 then 447
when 214797 then 448
when 75082 then 449
when 225472 then 450
when 222946 then 451
when 206014 then 452
when 211046 then 453
when 257087 then 454
when 267131 then 455
when 279899 then 456
when 279897 then 457
when 150077 then 458
when 181445 then 459
when 181455 then 460
when 255315 then 461
when 195498 then 462
when 165306 then 463
when 188370 then 464
when 199541 then 465
when 267676 then 466
when 267977 then 467
when 286850 then 468
when 225789 then 469
when 225794 then 470
when 246097 then 471
when 123068 then 472
when 212051 then 473
when 316934 then 474
when 118152 then 475
when 267398 then 476
when 311586 then 477
when 288981 then 478
when 189731 then 479
when 317823 then 480
when 116877 then 481
when 217689 then 482
when 289195 then 483
when 302761 then 484
when 135467 then 485
when 176432 then 486
when 214795 then 487
when 264023 then 488
when 209577 then 489
when 147504 then 490
when 103380 then 491
when 112779 then 492
when 157814 then 493
when 155325 then 494
when 217525 then 495
when 267133 then 496
when 165308 then 497
when 189521 then 498
when 220710 then 499
when 266039 then 500
when 267132 then 501
when 309357 then 502
when 195792 then 503
when 164234 then 504
when 250692 then 505
when 255317 then 506
when 266467 then 507
when 267064 then 508
when 283774 then 509
when 198571 then 510
when 200023 then 511
when 125889 then 512
when 189717 then 513
when 262121 then 514
when 287834 then 515
when 262919 then 516
when 267171 then 517
when 316925 then 518
when 267429 then 519
when 268830 then 520
when 277763 then 521
when 279382 then 522
when 296192 then 523
when 298253 then 524
when 256891 then 525
when 73377 then 526
when 188371 then 527
when 188658 then 528
when 194068 then 529
when 204017 then 530
when 206165 then 531
when 323600 then 532
when 134540 then 533
when 252650 then 534
when 273256 then 535
when 282379 then 536
when 301818 then 537
when 319900 then 538
when 212048 then 539
when 218513 then 540
when 296997 then 541
when 245341 then 542
when 245343 then 543
when 264992 then 544
when 122561 then 545
when 317001 then 546
when 207156 then 547
when 323567 then 548
when 287294 then 549
when 302438 then 550
when 122426 then 551
when 317821 then 552
when 113905 then 553
when 123067 then 554
when 300549 then 555
when 253557 then 556
when 287424 then 557
when 322307 then 558
when 189714 then 559
when 197597 then 560
when 200025 then 561
when 212055 then 562
when 132361 then 563
when 267399 then 564
when 208686 then 565
when 249391 then 566
when 266852 then 567
when 311583 then 568
when 204035 then 569
when 245342 then 570
when 225744 then 571
when 126076 then 572
when 113256 then 573
when 161536 then 574
when 168129 then 575
when 141657 then 576
when 189897 then 577
when 131308 then 578
when 132560 then 579
when 282685 then 580
when 296917 then 581
when 303048 then 582
when 298667 then 583
when 147986 then 584
when 293018 then 585
when 216670 then 586
when 267425 then 587
when 283893 then 588
when 298254 then 589
when 298255 then 590
when 298256 then 591
when 298257 then 592
when 298258 then 593
when 298261 then 594
when 198698 then 595
when 218298 then 596
when 154631 then 597
when 202128 then 598
when 253144 then 599
when 262470 then 600
when 245304 then 601
when 124568 then 602
when 252076 then 603
when 225769 then 604
when 225770 then 605
when 222725 then 606
when 113775 then 607
when 296259 then 608
when 317141 then 609
when 267335 then 610
when 325080 then 611
when 245293 then 612
when 212065 then 613
when 103362 then 614
when 133336 then 615
when 200022 then 616
when 216322 then 617
when 225780 then 618
when 289977 then 619
when 296336 then 620
when 318091 then 621
when 318093 then 622
when 267467 then 623
when 135490 then 624
when 331228 then 625
when 191510 then 626
when 124362 then 627
when 112488 then 628
when 112486 then 629
when 72176 then 630
when 49014 then 631
when 246698 then 632
when 260639 then 633
when 260751 then 634
when 266507 then 635
when 316913 then 636
when 302119 then 637
when 281541 then 638
when 131325 then 639
when 282913 then 640
when 216712 then 641
when 204968 then 642
when 205171 then 643
when 216325 then 644
when 216327 then 645
when 216324 then 646
when 225781 then 647
when 302189 then 648
when 302190 then 649
when 170286 then 650
when 215608 then 651
when 246099 then 652
when 326266 then 653
when 123667 then 654
when 112778 then 655
when 175529 then 656
when 161668 then 657
when 220292 then 658
when 212950 then 659
when 294854 then 660
when 294878 then 661
when 317822 then 662
when 201480 then 663
when 325036 then 664
when 212052 then 665
when 212060 then 666
when 124567 then 667
when 266279 then 668
when 216122 then 669
when 216128 then 670
when 216127 then 671
when 290128 then 672
when 302627 then 673
when 85739 then 674
when 266660 then 675
when 251836 then 676
when 183743 then 677
when 196856 then 678
when 216323 then 679
when 216328 then 680
when 296789 then 681
when 296790 then 682
when 268644 then 683
when 141297 then 684
when 256199 then 685
when 256918 then 686
when 213979 then 687
when 267671 then 688
when 256087 then 689
when 320642 then 690
when 246098 then 691
when 260753 then 692
when 147439 then 693
when 266350 then 694
when 40245 then 695
when 40246 then 696
when 147372 then 697
when 249244 then 698
when 251436 then 699
when 135482 then 700
when 135769 then 701
when 200772 then 702
when 212071 then 703
when 260864 then 704
when 225959 then 705
when 225963 then 706
when 225962 then 707
when 270613 then 708
when 216123 then 709
when 300539 then 710
when 302576 then 711
when 305155 then 712
when 216124 then 713
when 130754 then 714
when 130756 then 715
when 267117 then 716
when 253505 then 717
when 262351 then 718
when 112487 then 719
when 311935 then 720
when 311936 then 721
when 317040 then 722
when 317035 then 723
when 213725 then 724
when 254185 then 725
when 261386 then 726
when 209580 then 727
when 189442 then 728
when 283610 then 729
when 744 then 730
when 245296 then 731
when 215222 then 732
when 270967 then 733
when 266581 then 734
when 305362 then 735
when 192094 then 736
when 283416 then 737
when 302120 then 738
when 283971 then 739
when 248457 then 740
when 223037 then 741
when 296769 then 742
when 192842 then 743
when 323151 then 744
when 323152 then 745
when 128798 then 746
when 74484 then 747
when 202477 then 748
when 209579 then 749
when 301204 then 750
when 311591 then 751
when 225960 then 752
when 225961 then 753
when 249012 then 754
when 317134 then 755
when 123054 then 756
when 118167 then 757
when 248463 then 758
when 250641 then 759
when 124652 then 760
when 226012 then 761
when 249013 then 762
when 316871 then 763
when 316869 then 764
when 296303 then 765
when 296304 then 766
when 133954 then 767
when 306979 then 768
when 114240 then 769
when 253220 then 770
when 323615 then 771
when 192058 then 772
when 108722 then 773
when 223038 then 774
when 305368 then 775
when 250020 then 776
when 247124 then 777
when 256196 then 778
when 328898 then 779
when 316870 then 780
when 264451 then 781
when 195436 then 782
when 124935 then 783
when 29581 then 784
when 84272 then 785
when 161644 then 786
when 316851 then 787
when 316854 then 788
when 316852 then 789
when 316853 then 790
when 125496 then 791
when 264493 then 792
when 189716 then 793
when 212059 then 794
when 182204 then 795
when 188392 then 796
when 188394 then 797
when 249213 then 798
when 266962 then 799
when 296339 then 800
when 304954 then 801
when 328742 then 802
when 328747 then 803
when 264082 then 804
when 316865 then 805
when 316868 then 806
when 316867 then 807
when 271355 then 808
when 267327 then 809
when 323730 then 810
when 155642 then 811
when 316856 then 812
when 321293 then 813
when 249899 then 814
when 249897 then 815
when 125231 then 816
when 121930 then 817
when 23924 then 818
when 248459 then 819
when 248462 then 820
when 253494 then 821
when 267426 then 822
when 267428 then 823
when 192832 then 824
when 180047 then 825
when 200466 then 826
when 223010 then 827
when 249209 then 828
when 249214 then 829
when 249211 then 830
when 249215 then 831
when 253745 then 832
when 253747 then 833
when 205642 then 834
when 124936 then 835
when 328741 then 836
when 318106 then 837
when 316496 then 838
when 263246 then 839
when 298218 then 840
when 276860 then 841
when 216129 then 842
when 191550 then 843
when 248693 then 844
when 142969 then 845
when 248458 then 846
when 267199 then 847
when 268829 then 848
when 206922 then 849
when 296763 then 850
when 303288 then 851
when 303289 then 852
when 267978 then 853
when 255631 then 854
when 122149 then 855
when 125435 then 856
when 121165 then 857
when 148591 then 858
when 253742 then 859
when 281096 then 860
when 283960 then 861
when 296114 then 862
when 232185 then 863
when 304951 then 864
when 328746 then 865
when 264308 then 866
when 267717 then 867
when 130878 then 868
when 267427 then 869
when 264736 then 870
when 246716 then 871
when 283894 then 872
when 296764 then 873
when 296765 then 874
when 296766 then 875
when 323599 then 876
when 202914 then 877
when 212056 then 878
when 170446 then 879
when 249011 then 880
when 281114 then 881
when 254561 then 882
when 318097 then 883
when 29586 then 884
when 253524 then 885
when 208386 then 886
when 153210 then 887
when 73263 then 888
when 316987 then 889
when 281617 then 890
when 60266 then 891
when 269443 then 892
when 148004 then 893
when 147992 then 894
when 156078 then 895
when 288861 then 896
when 52140 then 897
when 162563 then 898
when 122022 then 899
when 124548 then 900
when 200558 then 901
when 245359 then 902
when 249210 then 903
when 266915 then 904
when 263055 then 905
when 128669 then 906
when 182533 then 907
when 316882 then 908
when 189459 then 909
when 143020 then 910
when 254925 then 911
when 208385 then 912
when 283775 then 913
when 283887 then 914
when 182 then 915
when 323612 then 916
when 317140 then 917
when 133212 then 918
when 165311 then 919
when 162137 then 920
when 124370 then 921
when 196973 then 922
when 281610 then 923
when 272514 then 924
when 268816 then 925
when 195554 then 926
when 267120 then 927
when 254165 then 928
when 130228 then 929
when 312343 then 930
when 247851 then 931
when 256399 then 932
when 294703 then 933
when 304966 then 934
when 304967 then 935
when 304968 then 936
when 188297 then 937
when 296685 then 938
when 208597 then 939
when 329659 then 940
when 267649 then 941
when 151116 then 942
when 60267 then 943
when 231822 then 944
when 111742 then 945
when 101747 then 946
when 256916 then 947
when 256919 then 948
when 267430 then 949
when 267431 then 950
when 267432 then 951
when 268827 then 952
when 217085 then 953
when 296302 then 954
when 320643 then 955
when 210100 then 956
when 76493 then 957
when 119883 then 958
when 135591 then 959
when 197834 then 960
when 213510 then 961
when 217883 then 962
when 257024 then 963
when 325981 then 964
when 195555 then 965
when 279483 then 966
when 264524 then 967
when 307591 then 968
when 210177 then 969
when 215223 then 970
when 215220 then 971
when 215221 then 972
when 245360 then 973
when 245361 then 974
when 248475 then 975
when 264445 then 976
when 225970 then 977
when 304953 then 978
when 80940 then 979
when 129748 then 980
when 62189 then 981
when 304461 then 982
when 75750 then 983
when 158745 then 984
when 158744 then 985
when 154997 then 986
when 195497 then 987
when 197713 then 988
when 201185 then 989
when 228061 then 990
when 179653 then 991
when 23400 then 992
when 256905 then 993
when 256917 then 994
when 256915 then 995
when 268828 then 996
when 182509 then 997
when 266930 then 998
when 305018 then 999
when 305296 then 1000
else 1000
end as ranking,
max(a.non_invt) as non_invt,sum(qoh + qc) as available,max(a.dept) as dept,max(a.brand) as brand,max(a.of3) as of3,case when sum(qoh + qc) > 0 then 1 else 0 end as instock
FROM web_all_products a WITH (NOLOCK)
INNER JOIN dbo.tb_skus b WITH (NOLOCK) ON (a.style_id = b.style_id)
INNER JOIN dbo.tb_sku_buckets c WITH (NOLOCK) ON (b.sku_id = c.sku_id and c.store_id in (10,32))
INNER JOIN dbo.tb_styles_web_taxonomy d WITH (NOLOCK) ON (a.style_id = d.style)
INNER JOIN dbo.tb_styles qq WITH (NOLOCK) ON (qq.style_id = a.style_id)
where a.style_id in (10953,10955,146845,10952,137552,256864,10954,256760,123701,104860,124573,124244,43642,267030,272963,266615,256286,218511,262364,266832,113257,76379,265008,253093,135361,267378,43625,65699,179106,248432,43635,255122,263808,179750,43626,185615,222359,263960,262373,263790,266635,256892,256645,43634,182387,249008,263202,267065,192608,261486,111535,267057,179122,252395,11376,273798,251566,254385,249965,170855,264739,218516,264446,304757,260785,206584,266755,261170,117030,222566,121131,179108,250882,177538,104547,154995,301457,109005,267397,179120,266646,255271,49055,123170,247648,76932,266067,178953,256287,273959,264820,200180,124721,218515,283949,264756,266580,273568,245440,122549,152052,278157,100336,251418,266923,49050,214430,74885,147427,250995,255616,260619,261492,179458,152681,122644,288892,113771,221046,221044,225759,179109,267395,253332,298925,196128,169560,251759,266068,267337,266134,129318,287260,217711,87275,266495,263421,251688,263245,125806,116657,302756,126346,192170,114579,268769,129037,309700,266385,266696,218512,266485,274203,298175,279779,133955,250992,283771,202970,126190,219982,254225,128766,124869,133333,170287,132599,213013,124089,245159,123031,286445,251689,251561,213786,289245,124087,268642,168578,179121,17075,281898,303291,11415,256290,288675,298195,49057,168610,203983,278069,302759,266509,203445,43620,307357,155732,232439,266106,250994,293326,208049,144145,202977,288672,11401,165141,11414,105193,266103,78029,141725,193279,213270,266842,245655,266623,125087,115793,108741,141298,108807,304452,327068,282916,213055,282684,253248,11411,218299,254228,193278,193947,252394,282912,217657,298095,162136,162135,260879,141772,251692,251690,316981,252427,117637,287198,298178,298176,298177,143337,250883,274194,101828,256447,256449,100013,179107,140065,217691,311584,303332,303333,134638,245163,94332,256415,264422,261488,253141,268848,154978,254357,256448,125157,252338,211307,218558,255963,216843,298179,252075,148056,256863,104303,267029,271278,43618,263389,133694,195861,212945,154822,287197,263642,246789,199005,256961,262887,124347,267325,253171,283765,74159,207657,125601,288893,266645,245074,277871,276238,132789,284842,100197,219631,191387,278931,205704,266910,289197,266657,167637,199950,277868,277869,283773,232275,248797,189572,203293,268632,284621,284619,282380,303793,323906,195395,219976,249242,264021,118290,281631,328743,328753,164526,245215,245454,127958,220594,110708,264651,183929,198570,206013,254378,268649,316495,328554,265007,141770,158504,121650,220694,262101,122940,225810,269140,328752,245362,264975,318099,318100,318101,125473,218056,66225,166590,283769,158990,182203,193310,268639,288987,204441,221152,268646,172539,175955,207029,298094,287293,123033,318102,225772,66003,220601,86317,254483,298639,249343,192600,245441,169790,118581,295087,320513,252391,289196,298196,188154,196117,169038,199982,253098,319392,248801,100312,251435,260823,283950,288674,302121,196975,271039,182037,168130,104498,189132,199540,220709,271297,263560,262886,225795,122572,189711,192093,271544,43641,302760,102294,13880,141771,175961,181162,196372,214796,214797,75082,225472,222946,206014,211046,257087,267131,279899,279897,150077,181445,181455,255315,195498,165306,188370,199541,267676,267977,286850,225789,225794,246097,123068,212051,316934,118152,267398,311586,288981,189731,317823,116877,217689,289195,302761,135467,176432,214795,264023,209577,147504,103380,112779,157814,155325,217525,267133,165308,189521,220710,266039,267132,309357,195792,164234,250692,255317,266467,267064,283774,198571,200023,125889,189717,262121,287834,262919,267171,316925,267429,268830,277763,279382,296192,298253,256891,73377,188371,188658,194068,204017,206165,323600,134540,252650,273256,282379,301818,319900,212048,218513,296997,245341,245343,264992,122561,317001,207156,323567,287294,302438,122426,317821,113905,123067,300549,253557,287424,322307,189714,197597,200025,212055,132361,267399,208686,249391,266852,311583,204035,245342,225744,126076,113256,161536,168129,141657,189897,131308,132560,282685,296917,303048,298667,147986,293018,216670,267425,283893,298254,298255,298256,298257,298258,298261,198698,218298,154631,202128,253144,262470,245304,124568,252076,225769,225770,222725,113775,296259,317141,267335,325080,245293,212065,103362,133336,200022,216322,225780,289977,296336,318091,318093,267467,135490,331228,191510,124362,112488,112486,72176,49014,246698,260639,260751,266507,316913,302119,281541,131325,282913,216712,204968,205171,216325,216327,216324,225781,302189,302190,170286,215608,246099,326266,123667,112778,175529,161668,220292,212950,294854,294878,317822,201480,325036,212052,212060,124567,266279,216122,216128,216127,290128,302627,85739,266660,251836,183743,196856,216323,216328,296789,296790,268644,141297,256199,256918,213979,267671,256087,320642,246098,260753,147439,266350,40245,40246,147372,249244,251436,135482,135769,200772,212071,260864,225959,225963,225962,270613,216123,300539,302576,305155,216124,130754,130756,267117,253505,262351,112487,311935,311936,317040,317035,213725,254185,261386,209580,189442,283610,744,245296,215222,270967,266581,305362,192094,283416,302120,283971,248457,223037,296769,192842,323151,323152,128798,74484,202477,209579,301204,311591,225960,225961,249012,317134,123054,118167,248463,250641,124652,226012,249013,316871,316869,296303,296304,133954,306979,114240,253220,323615,192058,108722,223038,305368,250020,247124,256196,328898,316870,264451,195436,124935,29581,84272,161644,316851,316854,316852,316853,125496,264493,189716,212059,182204,188392,188394,249213,266962,296339,304954,328742,328747,264082,316865,316868,316867,271355,267327,323730,155642,316856,321293,249899,249897,125231,121930,23924,248459,248462,253494,267426,267428,192832,180047,200466,223010,249209,249214,249211,249215,253745,253747,205642,124936,328741,318106,316496,263246,298218,276860,216129,191550,248693,142969,248458,267199,268829,206922,296763,303288,303289,267978,255631,122149,125435,121165,148591,253742,281096,283960,296114,232185,304951,328746,264308,267717,130878,267427,264736,246716,283894,296764,296765,296766,323599,202914,212056,170446,249011,281114,254561,318097,29586,253524,208386,153210,73263,316987,281617,60266,269443,148004,147992,156078,288861,52140,162563,122022,124548,200558,245359,249210,266915,263055,128669,182533,316882,189459,143020,254925,208385,283775,283887,182,323612,317140,133212,165311,162137,124370,196973,281610,272514,268816,195554,267120,254165,130228,312343,247851,256399,294703,304966,304967,304968,188297,296685,208597,329659,267649,151116,60267,231822,111742,101747,256916,256919,267430,267431,267432,268827,217085,296302,320643,210100,76493,119883,135591,197834,213510,217883,257024,325981,195555,279483,264524,307591,210177,215223,215220,215221,245360,245361,248475,264445,225970,304953,80940,129748,62189,304461,75750,158745,158744,154997,195497,197713,201185,228061,179653,23400,256905,256917,256915,268828,182509,266930,305018,305296)
and ltrim(rtrim(lower(a.brand))) = 'spikes tactical'
and a.of3='MULTI'
group by a.style_id
order by instock desc, ranking asc
|